package com.tceasy.gateway.domain;

import com.tceasy.orm.annotation.Id;
import com.tceasy.orm.annotation.Index;
import com.tceasy.orm.annotation.Sdb;

import java.io.Serializable;
import java.util.*;

/**
 * Created by zhanghuan on 2016/4/5.
 * 开发者基本信息
 */
@Sdb(space = "openapi",collection = "developer")
public class OpenDeveloper implements Serializable{
    @Id
    String partner;/*合作账号*/
    String name;/*商户名称*/
    @Index(isUnique = true)
    String shortName;/*简称*/
    String email;/*邮箱*/
    String contactPerson;/*联系人*/
    String contactNum;/*联系人电话*/
    String remarks;/*备注*/

    String key;/*md5掩码key*/
    String publicKey;/*rsa公钥*/
    List<String> ips=new ArrayList<>();/*白名单ip,如果空代表允许所有ip访问*/
    List<OpenPermission> permission=new ArrayList<>();/*接口权限列表*/
    Map<String,String> extParam=new HashMap<>();/*商户扩展参数*/
    @Index
    String state;/*开关状态：Y开，N关*/
    Date createDate;/*接入时间*/

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getContactPerson() {
        return contactPerson;
    }

    public void setContactPerson(String contactPerson) {
        this.contactPerson = contactPerson;
    }

    public String getContactNum() {
        return contactNum;
    }

    public void setContactNum(String contactNum) {
        this.contactNum = contactNum;
    }

    public String getPartner() {
        return partner;
    }

    public void setPartner(String partner) {
        this.partner = partner;
    }

    public List<String> getIps() {
        return ips;
    }

    public void setIps(List<String> ips) {
        this.ips = ips;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getPublicKey() {
        return publicKey;
    }

    public void setPublicKey(String publicKey) {
        this.publicKey = publicKey;
    }


    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Map getExtParam() {
        if(extParam==null){
            return new HashMap();
        }
        return extParam;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public void setExtParam(Map extParam) {
        this.extParam = extParam;
    }

    public List<OpenPermission> getPermission() {
        return permission;
    }

    public void setPermission(List<OpenPermission> permission) {
        this.permission = permission;
    }

    private static final long serialVersionUID = 1L;

    @Override
    public String toString() {
        return "OpenDeveloper{" +
                "partner='" + partner + '\'' +
                ", name='" + name + '\'' +
                ", shortName='" + shortName + '\'' +
                ", email='" + email + '\'' +
                ", contactPerson='" + contactPerson + '\'' +
                ", contactNum='" + contactNum + '\'' +
                ", remarks='" + remarks + '\'' +
                ", key='" + key + '\'' +
                ", publicKey='" + publicKey + '\'' +
                ", ips=" + ips +
                ", permission=" + permission +
                ", extParam=" + extParam +
                ", state='" + state + '\'' +
                ", createDate=" + createDate +
                '}';
    }
}


